import { lazy } from "react";
import {
  PieChartOutlined,
  SettingOutlined,
  AppstoreOutlined,
  BankOutlined,
  VideoCameraOutlined,
  DingtalkOutlined,
  PlaySquareOutlined,
  CalculatorOutlined,
  BugOutlined,
} from "@ant-design/icons";
const Dashboard = lazy(() => import("../views/dashboard/Dashboard"));
const Product = lazy(() => import("../views/product/Product"));
const Manager = lazy(() => import("../views/product/Manager"));
const Add = lazy(() => import("../views/product/Add"));
const Disuse = lazy(() => import("../views/product/Disuse"));
const Setting = lazy(() => import("../views/setting/Setting"));
const Orderlist = lazy(() => import("../views/product/orders/Orderlist")); //订单列表
const OrderDetails = lazy(() => import("../component/Orders/OrderDetails")); //订单详情
const Warehousemanage = lazy(() => import("../views/product/Warehousemanage")); //仓库管理
const Sortingmonitor = lazy(() => import("../views/product/Sortingmonitor")); //分拣监控
const Deliverymonitor = lazy(() => import("../views/product/Deliverymonitor")); //配送监控
const Livemanage = lazy(() => import("../views/product/Livemanage")); //直播管理
const Rolemanage = lazy(() => import("../views/product/Rolemanage")); //角色管理
const Addrole = lazy(() => import("../views/product/Addrole")); //添加角色
const Adddepartment = lazy(() => import("../views/product/Adddepart")); //添加部门
const Addacount = lazy(() => import("../views/product/Addacounts")); //添加用户
const warehouseAdd = lazy(() => import("../views/product/warehouseAdd")); //添加仓库
const Departmentmanage = lazy(() =>
  import("../views/product/Departmentmanage")
); //部门管理
const Accountmanage = lazy(() => import("../views/product/Accountmanage")); //角色管理
const routes = [
  {
    //仪表盘
    path: "/",
    component: Dashboard,
    exact: true,
    label: "用户管理",
    icon: <PieChartOutlined />,
  },
  //产品
  {
    path: "/product",
    component: Product,
    label: "商品管理",
    icon: <AppstoreOutlined />,
    hasSubMenu: true,
    routes: [
      {
        path: "/product/manager",
        component: Manager,
        label: "商品列表",
        routes: [
          {
            path: "/product/manager/add",
            component: Add,
            label: "新增商品",
          },
        ],
      },
      {
        path: "/product/disuse",
        component: Disuse,
        label: "分类列表",
      },
    ],
  },
  //订单列表
  {
    path: "/order",
    component: Orderlist,
    label: "订单管理",
    icon: <CalculatorOutlined />,
    hasSubMenu: true,
    routes: [
      {
        path: "/order/orderlist",
        component: Orderlist,
        label: "订单列表",
        routes: [
          {
            path: "/order/orderlist/OrderDetails",
            component: OrderDetails,
            label: "订单详情",
          },
        ],
      },
    ],
  },
  //仓库管理
  {
    path: "/warehosemanage",
    component: Warehousemanage,
    label: "仓库管理",
    icon: <BankOutlined />,
    routes: [
      {
        path: "/warehosemanage/warehouseAdd",
        component: warehouseAdd,
        label: "新增仓库",
      },
    ],
  },
  //分拣监控
  {
    path: "/sortingmonitor",
    component: Sortingmonitor,
    label: "分拣监控",
    icon: <VideoCameraOutlined />,
  },
  //配送监控
  {
    path: "/deliverymonitor",
    component: Deliverymonitor,
    label: "配送监控",
    icon: <DingtalkOutlined />,
  },
  //直播管理
  {
    path: "/livemanage",
    component: Livemanage,
    label: "直播管理",
    icon: <PlaySquareOutlined />,
  },
  //权限中心
  {
    path: "/permissions",
    component: Product,
    label: "权限中心",
    icon: <BugOutlined />,
    hasSubMenu: true,
    routes: [
      {
        path: "/permissions/rolemanage",
        component: Rolemanage,
        label: "角色管理",
        routes: [
          {
            path: "/permissions/rolemanage/addrole",
            component: Addrole,
            label: "添加角色",
          },
        ],
      },
      {
        path: "/permissions/departmentmanage",
        component: Departmentmanage,
        label: "部门管理",
        routes: [
          {
            path: "/permissions/departmentmanage/adddepartment",
            component: Adddepartment,
            label: "添加部门",
          },
        ],
      },
      {
        path: "/permissions/accountmanage",
        component: Accountmanage,
        label: "账号管理",
        routes: [
          {
            path: "/permissions/accountmanage/addcount",
            component: Addacount,
            label: "添加账号",
          },
        ],
      },
    ],
  },
  //设置
  {
    path: "/setting",
    component: Setting,
    label: "设置",
    icon: <SettingOutlined />,
  },
];

export default routes;
